﻿internal class car
{
    public string Name;
    private string Color;
    public int Miles_per_gallon;

    public car(string name, string color, int miles_per_gallon)
    {
        Name = name;
        Color = color;
        Miles_per_gallon = miles_per_gallon;
    }

    public car(string name, string color)
    {
        Name = name; 
        Color = color;
    }

    public virtual int Calculate_fuel_for_trip(int trip_distance)
    {
        return trip_distance / Miles_per_gallon;
    }
    public virtual void PrintCarDetails()
    {
        System.Console.WriteLine("--- Car Details ---");
        System.Console.WriteLine("Car Owner: {0}", Name);
        System.Console.WriteLine("Car Color: {0}", Color);
        System.Console.WriteLine("Gas Mileage: {0} mpg", Miles_per_gallon);
    }
}

class Volvo_car : car
{
    public string Volvo_sound_system;

    public Volvo_car(string name, string color, int mpg, string sound)
        :base(name, color)
    {
        Volvo_sound_system = sound;
        Miles_per_gallon = mpg;
    }

    public override void PrintCarDetails()
    {
        base.PrintCarDetails();
        Console.WriteLine("volvo_sound_system:{0}", Volvo_sound_system);
    }
}

class Ford_car : car
{
    public string Ford_wheels_option;

    public Ford_car(string name, string color, int mpg, string wheels)
        :base(name, color, mpg)
    {
        Ford_wheels_option = wheels;
    }
    public override void PrintCarDetails()
    {
        base.PrintCarDetails();
        Console.WriteLine("Ford_wheels_option:{0}", Ford_wheels_option);
    }
}

class Volvo30 : Volvo_car
{
    public Volvo30(string name, string color, int mpg, string sound)
        :base (name, color, mpg, sound)
    {

    }
}

class Ford_fiesta : Ford_car
{
    public Ford_fiesta(string name, string color, int mpg, string wheels)
        : base(name, color, mpg, wheels)
    {

    }
}

class OOP5
{
    static void Main(string[] args)
    {
        Volvo30 myv30 = new Volvo30("wzy", "black", 40, "High");
        myv30.PrintCarDetails();

        Ford_fiesta myfiesta = new Ford_fiesta("fyf", "red", 30, "18 inch sports");
        myfiesta.PrintCarDetails();

        Console.ReadKey();
    }
}
